package com.gloaba.gateway.service.impl;

import com.gloaba.common.log.constant.LogMqConstants;
import com.gloaba.common.log.domain.ApiRequestLog;
import com.gloaba.common.mq.utils.MqUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class AsyncApiLogService {

    private final MqUtils mqUtils;

    @Async
    public void saveApiLogInfo(ApiRequestLog apiRequestLog){
        mqUtils.sendQueue(LogMqConstants.LOG_API_GATWEWAY_QUEUE, apiRequestLog);
    }
}
